<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>World - p2.js</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">
    <script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
                <h1><img src="../assets/css/logo.png" title="p2.js" width="117" height="52"></h1>
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Docs for: 0.7.1</em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
                    <h2 class="off-left">APIs</h2>
                    <div id="api-tabview" class="tabview">
                        <ul class="tabs">
                            <li><a href="#api-classes">Classes</a></li>
                            <li><a href="#api-modules">Modules</a></li>
                        </ul>
                
                        <div id="api-tabview-filter">
                            <input type="search" id="api-filter" placeholder="Type to filter APIs">
                        </div>
                
                        <div id="api-tabview-panel">
                            <ul id="api-classes" class="apis classes">
                                <li><a href="../classes/AABB.html">AABB</a></li>
                                <li><a href="../classes/AngleLockEquation.html">AngleLockEquation</a></li>
                                <li><a href="../classes/Body.html">Body</a></li>
                                <li><a href="../classes/Box.html">Box</a></li>
                                <li><a href="../classes/Broadphase.html">Broadphase</a></li>
                                <li><a href="../classes/Capsule.html">Capsule</a></li>
                                <li><a href="../classes/Circle.html">Circle</a></li>
                                <li><a href="../classes/Constraint.html">Constraint</a></li>
                                <li><a href="../classes/ContactEquation.html">ContactEquation</a></li>
                                <li><a href="../classes/ContactMaterial.html">ContactMaterial</a></li>
                                <li><a href="../classes/Convex.html">Convex</a></li>
                                <li><a href="../classes/DistanceConstraint.html">DistanceConstraint</a></li>
                                <li><a href="../classes/Equation.html">Equation</a></li>
                                <li><a href="../classes/EventEmitter.html">EventEmitter</a></li>
                                <li><a href="../classes/FrictionEquation.html">FrictionEquation</a></li>
                                <li><a href="../classes/GearConstraint.html">GearConstraint</a></li>
                                <li><a href="../classes/GSSolver.html">GSSolver</a></li>
                                <li><a href="../classes/Heightfield.html">Heightfield</a></li>
                                <li><a href="../classes/Island.html">Island</a></li>
                                <li><a href="../classes/IslandManager.html">IslandManager</a></li>
                                <li><a href="../classes/IslandNode.html">IslandNode</a></li>
                                <li><a href="../classes/Line.html">Line</a></li>
                                <li><a href="../classes/LinearSpring.html">LinearSpring</a></li>
                                <li><a href="../classes/LockConstraint.html">LockConstraint</a></li>
                                <li><a href="../classes/Material.html">Material</a></li>
                                <li><a href="../classes/NaiveBroadphase.html">NaiveBroadphase</a></li>
                                <li><a href="../classes/Narrowphase.html">Narrowphase</a></li>
                                <li><a href="../classes/Object pooling utility..html">Object pooling utility.</a></li>
                                <li><a href="../classes/OverlapKeeper.html">OverlapKeeper</a></li>
                                <li><a href="../classes/OverlapKeeperRecord.html">OverlapKeeperRecord</a></li>
                                <li><a href="../classes/Particle.html">Particle</a></li>
                                <li><a href="../classes/Plane.html">Plane</a></li>
                                <li><a href="../classes/PrismaticConstraint.html">PrismaticConstraint</a></li>
                                <li><a href="../classes/Ray.html">Ray</a></li>
                                <li><a href="../classes/RaycastResult.html">RaycastResult</a></li>
                                <li><a href="../classes/RevoluteConstraint.html">RevoluteConstraint</a></li>
                                <li><a href="../classes/RotationalLockEquation.html">RotationalLockEquation</a></li>
                                <li><a href="../classes/.html"></a></li>
                                <li><a href="../classes/RotationalSpring.html">RotationalSpring</a></li>
                                <li><a href="../classes/RotationalVelocityEquation.html">RotationalVelocityEquation</a></li>
                                <li><a href="../classes/SAPBroadphase.html">SAPBroadphase</a></li>
                                <li><a href="../classes/Shape.html">Shape</a></li>
                                <li><a href="../classes/Solver.html">Solver</a></li>
                                <li><a href="../classes/Spring.html">Spring</a></li>
                                <li><a href="../classes/TopDownVehicle.html">TopDownVehicle</a></li>
                                <li><a href="../classes/TupleDictionary.html">TupleDictionary</a></li>
                                <li><a href="../classes/Utils.html">Utils</a></li>
                                <li><a href="../classes/vec2.html">vec2</a></li>
                                <li><a href="../classes/WheelConstraint.html">WheelConstraint</a></li>
                                <li><a href="../classes/World.html">World</a></li>
                            </ul>
                
                            <ul id="api-modules" class="apis modules">
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="yui3-u-3-4">
                <div id="api-options">
                    Show:
                    <label for="api-show-inherited">
                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited
                    </label>
            
                    <label for="api-show-protected">
                        <input type="checkbox" id="api-show-protected">
                        Protected
                    </label>
            
                    <label for="api-show-private">
                        <input type="checkbox" id="api-show-private">
                        Private
                    </label>
                    <label for="api-show-deprecated">
                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated
                    </label>
            
                </div>
            
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
<h1>World Class</h1>
<div class="box meta">

        <div class="extends">
            Extends <a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a>
        </div>

        <div class="foundat">
            Defined in: <a href="../files/src_world_World.js.html#l35"><code>src&#x2F;world&#x2F;World.js:35</code></a>
        </div>


</div>


<div class="box intro">
    <p>The dynamics world, where all bodies and constraints live.</p>

</div>

    <div class="constructor">
        <h2>Constructor</h2>
        <div id="method_World" class="method item">
            <h3 class="name"><code>World</code></h3>
        
                <div class="args">
                    <span class="paren">(</span><ul class="args-list inline commas">
                        <li class="arg">
                                <code class="optional">[options]</code>
                        </li>
                    </ul><span class="paren">)</span>
                </div>
        
        
        
        
        
        
        
        
            <div class="meta">
                        <p>
                        Defined in
                <a href="../files/src_world_World.js.html#l35"><code>src&#x2F;world&#x2F;World.js:35</code></a>
                </p>
        
        
        
            </div>
        
            <div class="description">
                
            </div>
        
                <div class="params">
                    <h4>Parameters:</h4>
        
                    <ul class="params-list">
                        <li class="param">
                                <code class="param-name optional">[options]</code>
                                <span class="type">Object</span>
                                <span class="flag optional" title="This parameter is optional.">optional</span>
        
        
                            <div class="param-description">
                                 
                            </div>
        
                                <ul class="params-list">
                                    <li class="param">
                                            <code class="param-name optional">[solver]</code>
                                            <span class="type"><a href="../classes/Solver.html" class="crosslink">Solver</a></span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            <p>Defaults to GSSolver.</p>
        
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[gravity]</code>
                                            <span class="type">Array</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            <p>Defaults to y=-9.78.</p>
        
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[broadphase]</code>
                                            <span class="type"><a href="../classes/Broadphase.html" class="crosslink">Broadphase</a></span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            <p>Defaults to SAPBroadphase</p>
        
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[islandSplit=true]</code>
                                            <span class="type">Boolean</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                </ul>
                        </li>
                    </ul>
                </div>
        
        
        
                <div class="example">
                    <h4>Example:</h4>
        
                    <div class="example-content">
                        <pre class="code prettyprint"><code>var world = new World({
            gravity: [0, -10],
            broadphase: new SAPBroadphase()
        });
        world.addBody(new Body());
        </code></pre>
                    </div>
                </div>
        </div>
    </div>

<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
            <li class="api-class-tab properties"><a href="#properties">Properties</a></li>
            <li class="api-class-tab events"><a href="#events">Events</a></li>
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods extends">
                            <li class="index-item method">
                                <a href="#method_addBody">addBody</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_addConstraint">addConstraint</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_addContactMaterial">addContactMaterial</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_addSpring">addSpring</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_clear">clear</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_disableBodyCollision">disableBodyCollision</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_emit">emit</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_enableBodyCollision">enableBodyCollision</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getBodyById">getBodyById</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getContactMaterial">getContactMaterial</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_has">has</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_hitTest">hitTest</a>

                            </li>
                            <li class="index-item method private">
                                <a href="#method_internalStep">internalStep</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_off">off</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_on">on</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_raycast">raycast</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_removeBody">removeBody</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_removeConstraint">removeConstraint</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_removeContactMaterial">removeContactMaterial</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_removeSpring">removeSpring</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_runNarrowphase">runNarrowphase</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_setGlobalRelaxation">setGlobalRelaxation</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_setGlobalStiffness">setGlobalStiffness</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_step">step</a>

                            </li>
                    </ul>
                </div>

                <div class="index-section properties">
                    <h3>Properties</h3>

                    <ul class="index-list properties extends">
                            <li class="index-item property">
                                <a href="#property_applyDamping">applyDamping</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_applyGravity">applyGravity</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_applySpringForces">applySpringForces</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_bodies">bodies</a>

                            </li>
                            <li class="index-item property private">
                                <a href="#property_bodiesToBeRemoved">bodiesToBeRemoved</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_BODY_SLEEPING">BODY_SLEEPING</a>

                                    <span class="flag static">static</span>
                            </li>
                            <li class="index-item property">
                                <a href="#property_broadphase">broadphase</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_constraints">constraints</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_contactMaterials">contactMaterials</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_defaultContactMaterial">defaultContactMaterial</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_defaultMaterial">defaultMaterial</a>

                            </li>
                            <li class="index-item property private">
                                <a href="#property_disabledBodyCollisionPairs">disabledBodyCollisionPairs</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_emitImpactEvent">emitImpactEvent</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_frictionGravity">frictionGravity</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_gravity">gravity</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_ISLAND_SLEEPING">ISLAND_SLEEPING</a>

                                    <span class="flag static">static</span>
                            </li>
                            <li class="index-item property">
                                <a href="#property_islandManager">islandManager</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_islandSplit">islandSplit</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_lastTimeStep">lastTimeStep</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_narrowphase">narrowphase</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_NO_SLEEPING">NO_SLEEPING</a>

                                    <span class="flag static">static</span>
                            </li>
                            <li class="index-item property">
                                <a href="#property_overlapKeeper">overlapKeeper</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_sleepMode">sleepMode</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_solveConstraints">solveConstraints</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_solver">solver</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_springs">springs</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_stepping">stepping</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_time">time</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_useFrictionGravityOnZeroGravity">useFrictionGravityOnZeroGravity</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_useWorldGravityAsFrictionGravity">useWorldGravityAsFrictionGravity</a>

                            </li>
                    </ul>
                </div>


                <div class="index-section events">
                    <h3>Events</h3>

                    <ul class="index-list events extends">
                            <li class="index-item event">
                                <a href="#event_addBody">addBody</a>

                            </li>
                            <li class="index-item event">
                                <a href="#event_addSpring">addSpring</a>

                            </li>
                            <li class="index-item event">
                                <a href="#event_beginContact">beginContact</a>

                            </li>
                            <li class="index-item event">
                                <a href="#event_endContact">endContact</a>

                            </li>
                            <li class="index-item event">
                                <a href="#event_impact">impact</a>

                            </li>
                            <li class="index-item event">
                                <a href="#event_postBroadphase">postBroadphase</a>

                            </li>
                            <li class="index-item event">
                                <a href="#event_postStep">postStep</a>

                            </li>
                            <li class="index-item event">
                                <a href="#event_preSolve">preSolve</a>

                            </li>
                            <li class="index-item event">
                                <a href="#event_removeBody">removeBody</a>

                            </li>
                    </ul>
                </div>
        </div>

            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

<div id="method_addBody" class="method item">
    <h3 class="name"><code>addBody</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>body</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l982"><code>src&#x2F;world&#x2F;World.js:982</code></a>
        </p>



    </div>

    <div class="description">
        <p>Add a body to the simulation</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">body</code>
                        <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



        <div class="example">
            <h4>Example:</h4>

            <div class="example-content">
                <pre class="code prettyprint"><code>var world = new World(),
    body = new Body();
world.addBody(body);
</code></pre>
            </div>
        </div>
</div>
<div id="method_addConstraint" class="method item">
    <h3 class="name"><code>addConstraint</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>constraint</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l399"><code>src&#x2F;world&#x2F;World.js:399</code></a>
        </p>



    </div>

    <div class="description">
        <p>Add a constraint to the simulation.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">constraint</code>
                        <span class="type"><a href="../classes/Constraint.html" class="crosslink">Constraint</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



        <div class="example">
            <h4>Example:</h4>

            <div class="example-content">
                <pre class="code prettyprint"><code>var constraint = new LockConstraint(bodyA, bodyB);
world.addConstraint(constraint);
</code></pre>
            </div>
        </div>
</div>
<div id="method_addContactMaterial" class="method item">
    <h3 class="name"><code>addContactMaterial</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>contactMaterial</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l412"><code>src&#x2F;world&#x2F;World.js:412</code></a>
        </p>



    </div>

    <div class="description">
        <p>Add a ContactMaterial to the simulation.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">contactMaterial</code>
                        <span class="type"><a href="../classes/ContactMaterial.html" class="crosslink">ContactMaterial</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_addSpring" class="method item">
    <h3 class="name"><code>addSpring</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>spring</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l955"><code>src&#x2F;world&#x2F;World.js:955</code></a>
        </p>



    </div>

    <div class="description">
        <p>Add a spring to the simulation</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">spring</code>
                        <span class="type"><a href="../classes/Spring.html" class="crosslink">Spring</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_clear" class="method item">
    <h3 class="name"><code>clear</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l1070"><code>src&#x2F;world&#x2F;World.js:1070</code></a>
        </p>



    </div>

    <div class="description">
        <p>Resets the World, removes all bodies, constraints and springs.</p>

    </div>




</div>
<div id="method_disableBodyCollision" class="method item">
    <h3 class="name"><code>disableBodyCollision</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>bodyA</code>
                </li>
                <li class="arg">
                        <code>bodyB</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l1044"><code>src&#x2F;world&#x2F;World.js:1044</code></a>
        </p>



    </div>

    <div class="description">
        <p>Disable collision between two bodies</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">bodyA</code>
                        <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">bodyB</code>
                        <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_emit" class="method item inherited">
    <h3 class="name"><code>emit</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>event</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a></span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/EventEmitter.html#method_emit">EventEmitter</a>:
        <a href="../files/src_events_EventEmitter.js.html#l79"><code>src&#x2F;events&#x2F;EventEmitter.js:79</code></a>
        </p>



    </div>

    <div class="description">
        <p>Emit an event.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">event</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        
                    </div>

                        <ul class="params-list">
                            <li class="param">
                                    <code class="param-name">type</code>
                                    <span class="type">String</span>

                                <div class="param-description">
                                    
                                </div>

                            </li>
                        </ul>
                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a></span>:
                    <p>The self object, for chainability.</p>

            </div>
        </div>


</div>
<div id="method_enableBodyCollision" class="method item">
    <h3 class="name"><code>enableBodyCollision</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>bodyA</code>
                </li>
                <li class="arg">
                        <code>bodyB</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l1054"><code>src&#x2F;world&#x2F;World.js:1054</code></a>
        </p>



    </div>

    <div class="description">
        <p>Enable collisions between the given two bodies</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">bodyA</code>
                        <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">bodyB</code>
                        <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_getBodyById" class="method item">
    <h3 class="name"><code>getBodyById</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>id</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l1027"><code>src&#x2F;world&#x2F;World.js:1027</code></a>
        </p>



    </div>

    <div class="description">
        <p>Get a body by its id.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">id</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>:
                    <p>The body, or false if it was not found.</p>

            </div>
        </div>


</div>
<div id="method_getContactMaterial" class="method item">
    <h3 class="name"><code>getContactMaterial</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>materialA</code>
                </li>
                <li class="arg">
                        <code>materialB</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="../classes/ContactMaterial.html" class="crosslink">ContactMaterial</a></span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l434"><code>src&#x2F;world&#x2F;World.js:434</code></a>
        </p>



    </div>

    <div class="description">
        <p>Get a contact material given two materials</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">materialA</code>
                        <span class="type"><a href="../classes/Material.html" class="crosslink">Material</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">materialB</code>
                        <span class="type"><a href="../classes/Material.html" class="crosslink">Material</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="../classes/ContactMaterial.html" class="crosslink">ContactMaterial</a></span>:
                    <p>The matching ContactMaterial, or false on fail.</p>

            </div>
        </div>


</div>
<div id="method_has" class="method item inherited">
    <h3 class="name"><code>has</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>type</code>
                </li>
                <li class="arg">
                        <code>listener</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/EventEmitter.html#method_has">EventEmitter</a>:
        <a href="../files/src_events_EventEmitter.js.html#l35"><code>src&#x2F;events&#x2F;EventEmitter.js:35</code></a>
        </p>



    </div>

    <div class="description">
        <p>Check if an event listener is added</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">type</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">listener</code>
                        <span class="type">Function</span>


                    <div class="param-description">
                        
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
            </div>
        </div>


</div>
<div id="method_hitTest" class="method item">
    <h3 class="name"><code>hitTest</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>worldPoint</code>
                </li>
                <li class="arg">
                        <code>bodies</code>
                </li>
                <li class="arg">
                        <code>precision</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Array</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l1115"><code>src&#x2F;world&#x2F;World.js:1115</code></a>
        </p>



    </div>

    <div class="description">
        <p>Test if a world point overlaps bodies</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">worldPoint</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>Point to use for intersection tests</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">bodies</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>A list of objects to check for intersection</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">precision</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>Used for matching against particles and lines. Adds some margin to these infinitesimal objects.</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Array</span>:
                    <p>Array of bodies that overlap the point</p>

            </div>
        </div>


</div>
<div id="method_internalStep" class="method item private">
    <h3 class="name"><code>internalStep</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>dt</code>
                </li>
            </ul><span class="paren">)</span>
        </div>



        <span class="flag private">private</span>





    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l560"><code>src&#x2F;world&#x2F;World.js:560</code></a>
        </p>



    </div>

    <div class="description">
        <p>Make a fixed step.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">dt</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_off" class="method item inherited">
    <h3 class="name"><code>off</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>type</code>
                </li>
                <li class="arg">
                        <code>listener</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a></span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/EventEmitter.html#method_off">EventEmitter</a>:
        <a href="../files/src_events_EventEmitter.js.html#l60"><code>src&#x2F;events&#x2F;EventEmitter.js:60</code></a>
        </p>



    </div>

    <div class="description">
        <p>Remove an event listener</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">type</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">listener</code>
                        <span class="type">Function</span>


                    <div class="param-description">
                        
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a></span>:
                    <p>The self object, for chainability.</p>

            </div>
        </div>


</div>
<div id="method_on" class="method item inherited">
    <h3 class="name"><code>on</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>type</code>
                </li>
                <li class="arg">
                        <code>listener</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a></span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/EventEmitter.html#method_on">EventEmitter</a>:
        <a href="../files/src_events_EventEmitter.js.html#l13"><code>src&#x2F;events&#x2F;EventEmitter.js:13</code></a>
        </p>



    </div>

    <div class="description">
        <p>Add an event listener</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">type</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">listener</code>
                        <span class="type">Function</span>


                    <div class="param-description">
                        
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a></span>:
                    <p>The self object, for chainability.</p>

            </div>
        </div>


</div>
<div id="method_raycast" class="method item">
    <h3 class="name"><code>raycast</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>result</code>
                </li>
                <li class="arg">
                        <code>ray</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l1229"><code>src&#x2F;world&#x2F;World.js:1229</code></a>
        </p>



    </div>

    <div class="description">
        <p>Ray cast against all bodies in the world.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type"><a href="../classes/RaycastResult.html" class="crosslink">RaycastResult</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">ray</code>
                        <span class="type"><a href="../classes/Ray.html" class="crosslink">Ray</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>True if any body was hit.</p>

            </div>
        </div>


        <div class="example">
            <h4>Example:</h4>

            <div class="example-content">
                <pre class="code prettyprint"><code>var ray = new Ray({
    mode: Ray.CLOSEST, // or ANY
    from: [0, 0],
    to: [10, 0],
});
var result = new RaycastResult();
world.raycast(result, ray);

// Get the hit point
var hitPoint = vec2.create();
result.getHitPoint(hitPoint, ray);
console.log(&#39;Hit point: &#39;, hitPoint[0], hitPoint[1], &#39; at distance &#39; + result.getHitDistance(ray));
</code></pre><pre class="code prettyprint"><code>var ray = new Ray({
    mode: Ray.ALL,
    from: [0, 0],
    to: [10, 0],
    callback: function(result){

        // Print some info about the hit
        console.log(&#39;Hit body and shape: &#39;, result.body, result.shape);

        // Get the hit point
        var hitPoint = vec2.create();
        result.getHitPoint(hitPoint, ray);
        console.log(&#39;Hit point: &#39;, hitPoint[0], hitPoint[1], &#39; at distance &#39; + result.getHitDistance(ray));

        // If you are happy with the hits you got this far, you can stop the traversal here:
        result.stop();
    }
});
var result = new RaycastResult();
world.raycast(result, ray);
</code></pre>
            </div>
        </div>
</div>
<div id="method_removeBody" class="method item">
    <h3 class="name"><code>removeBody</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>body</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l1005"><code>src&#x2F;world&#x2F;World.js:1005</code></a>
        </p>



    </div>

    <div class="description">
        <p>Remove a body from the simulation. If this method is called during step(), the body removal is scheduled to after the step.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">body</code>
                        <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_removeConstraint" class="method item">
    <h3 class="name"><code>removeConstraint</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>constraint</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l454"><code>src&#x2F;world&#x2F;World.js:454</code></a>
        </p>



    </div>

    <div class="description">
        <p>Removes a constraint</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">constraint</code>
                        <span class="type"><a href="../classes/Constraint.html" class="crosslink">Constraint</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_removeContactMaterial" class="method item">
    <h3 class="name"><code>removeContactMaterial</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>cm</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l421"><code>src&#x2F;world&#x2F;World.js:421</code></a>
        </p>



    </div>

    <div class="description">
        <p>Removes a contact material</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">cm</code>
                        <span class="type"><a href="../classes/ContactMaterial.html" class="crosslink">ContactMaterial</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_removeSpring" class="method item">
    <h3 class="name"><code>removeSpring</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>spring</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l969"><code>src&#x2F;world&#x2F;World.js:969</code></a>
        </p>



    </div>

    <div class="description">
        <p>Remove a spring</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">spring</code>
                        <span class="type"><a href="../classes/Spring.html" class="crosslink">Spring</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_runNarrowphase" class="method item">
    <h3 class="name"><code>runNarrowphase</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>np</code>
                </li>
                <li class="arg">
                        <code>bi</code>
                </li>
                <li class="arg">
                        <code>si</code>
                </li>
                <li class="arg">
                        <code>xi</code>
                </li>
                <li class="arg">
                        <code>ai</code>
                </li>
                <li class="arg">
                        <code>bj</code>
                </li>
                <li class="arg">
                        <code>sj</code>
                </li>
                <li class="arg">
                        <code>xj</code>
                </li>
                <li class="arg">
                        <code>aj</code>
                </li>
                <li class="arg">
                        <code>mu</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l832"><code>src&#x2F;world&#x2F;World.js:832</code></a>
        </p>



    </div>

    <div class="description">
        <p>Runs narrowphase for the shape pair i and j.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">np</code>
                        <span class="type"><a href="../classes/Narrowphase.html" class="crosslink">Narrowphase</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">bi</code>
                        <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">si</code>
                        <span class="type"><a href="../classes/Shape.html" class="crosslink">Shape</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">xi</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">ai</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">bj</code>
                        <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">sj</code>
                        <span class="type"><a href="../classes/Shape.html" class="crosslink">Shape</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">xj</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">aj</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">mu</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_setGlobalRelaxation" class="method item">
    <h3 class="name"><code>setGlobalRelaxation</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>relaxation</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l1198"><code>src&#x2F;world&#x2F;World.js:1198</code></a>
        </p>



    </div>

    <div class="description">
        <p>Set the relaxation for all equations and contact materials.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">relaxation</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_setGlobalStiffness" class="method item">
    <h3 class="name"><code>setGlobalStiffness</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>stiffness</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l1168"><code>src&#x2F;world&#x2F;World.js:1168</code></a>
        </p>



    </div>

    <div class="description">
        <p>Set the stiffness for all equations and contact materials.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">stiffness</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_step" class="method item">
    <h3 class="name"><code>step</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>dt</code>
                </li>
                <li class="arg">
                        <code class="optional">[timeSinceLastCalled=0]</code>
                </li>
                <li class="arg">
                        <code class="optional">[maxSubSteps=10]</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_world_World.js.html#l479"><code>src&#x2F;world&#x2F;World.js:479</code></a>
        </p>



    </div>

    <div class="description">
        <p>Step the physics world forward in time.</p>
<p>There are two modes. The simple mode is fixed timestepping without interpolation. In this case you only use the first argument. The second case uses interpolation. In that you also provide the time since the function was last used, as well as the maximum fixed timesteps to take.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">dt</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>The fixed time step size to use.</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[timeSinceLastCalled=0]</code>
                        <span class="type">Number</span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                        <p>The time elapsed since the function was last called.</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[maxSubSteps=10]</code>
                        <span class="type">Number</span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                        <p>Maximum number of fixed steps to take per function call.</p>

                    </div>

                </li>
            </ul>
        </div>



        <div class="example">
            <h4>Example:</h4>

            <div class="example-content">
                <pre class="code prettyprint"><code>// Simple fixed timestepping without interpolation
var fixedTimeStep = 1 / 60;
var world = new World();
var body = new Body({ mass: 1 });
world.addBody(body);

function animate(){
    requestAnimationFrame(animate);
    world.step(fixedTimeStep);
    renderBody(body.position, body.angle);
}

// Start animation loop
requestAnimationFrame(animate);
</code></pre><pre class="code prettyprint"><code>// Fixed timestepping with interpolation
var maxSubSteps = 10;
var lastTimeSeconds;

function animate(t){
    requestAnimationFrame(animate);
    timeSeconds = t / 1000;
    lastTimeSeconds = lastTimeSeconds || timeSeconds;

    deltaTime = timeSeconds - lastTimeSeconds;
    world.step(fixedTimeStep, deltaTime, maxSubSteps);

    renderBody(body.interpolatedPosition, body.interpolatedAngle);
}

// Start animation loop
requestAnimationFrame(animate);
</code></pre>
            </div>
        </div>
</div>
            </div>

            <div id="properties" class="api-class-tabpanel">
                <h2 class="off-left">Properties</h2>

                    <div id="property_applyDamping" class="property item">
                        <h3 class="name"><code>applyDamping</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l175"><code>src&#x2F;world&#x2F;World.js:175</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Enable to automatically apply body damping each step.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> true</p>
                    
                    
                    </div>
                    <div id="property_applyGravity" class="property item">
                        <h3 class="name"><code>applyGravity</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l183"><code>src&#x2F;world&#x2F;World.js:183</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Enable to automatically apply gravity each step.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> true</p>
                    
                    
                    </div>
                    <div id="property_applySpringForces" class="property item">
                        <h3 class="name"><code>applySpringForces</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l167"><code>src&#x2F;world&#x2F;World.js:167</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Enable to automatically apply spring forces each step.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> true</p>
                    
                    
                    </div>
                    <div id="property_bodies" class="property item">
                        <h3 class="name"><code>bodies</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l67"><code>src&#x2F;world&#x2F;World.js:67</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>All bodies in the world. To add a body to the world, use <a href="../classes/World.html#method_addBody" class="crosslink">addBody</a>.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_bodiesToBeRemoved" class="property item private">
                        <h3 class="name"><code>bodiesToBeRemoved</code></h3>
                        <span class="type">Array</span>
                    
                    
                            <span class="flag private">private</span>
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l220"><code>src&#x2F;world&#x2F;World.js:220</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Bodies that are scheduled to be removed at the end of the step.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_BODY_SLEEPING" class="property item">
                        <h3 class="name"><code>BODY_SLEEPING</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                            <span class="flag static">static</span>
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l385"><code>src&#x2F;world&#x2F;World.js:385</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Deactivate individual bodies if they are sleepy.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_broadphase" class="property item">
                        <h3 class="name"><code>broadphase</code></h3>
                        <span class="type"><a href="../classes/Broadphase.html" class="crosslink">Broadphase</a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l131"><code>src&#x2F;world&#x2F;World.js:131</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The broadphase algorithm to use.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_constraints" class="property item">
                        <h3 class="name"><code>constraints</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l140"><code>src&#x2F;world&#x2F;World.js:140</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>User-added constraints.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_contactMaterials" class="property item">
                        <h3 class="name"><code>contactMaterials</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l199"><code>src&#x2F;world&#x2F;World.js:199</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The ContactMaterials added to the World.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_defaultContactMaterial" class="property item">
                        <h3 class="name"><code>defaultContactMaterial</code></h3>
                        <span class="type"><a href="../classes/ContactMaterial.html" class="crosslink">ContactMaterial</a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l154"><code>src&#x2F;world&#x2F;World.js:154</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The default contact material to use, if no contact material was set for the colliding materials.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_defaultMaterial" class="property item">
                        <h3 class="name"><code>defaultMaterial</code></h3>
                        <span class="type"><a href="../classes/Material.html" class="crosslink">Material</a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l148"><code>src&#x2F;world&#x2F;World.js:148</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Dummy default material in the world, used in .defaultContactMaterial</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_disabledBodyCollisionPairs" class="property item private">
                        <h3 class="name"><code>disabledBodyCollisionPairs</code></h3>
                        <span class="type">Array</span>
                    
                    
                            <span class="flag private">private</span>
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l73"><code>src&#x2F;world&#x2F;World.js:73</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Disabled body collision pairs. See {{#crossLink "World/disableBodyCollision:method"}}.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_emitImpactEvent" class="property item">
                        <h3 class="name"><code>emitImpactEvent</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l234"><code>src&#x2F;world&#x2F;World.js:234</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Set to true if you want to the world to emit the &quot;impact&quot; event. Turning this off could improve performance.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> true</p>
                    
                    
                    </div>
                    <div id="property_frictionGravity" class="property item">
                        <h3 class="name"><code>frictionGravity</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l111"><code>src&#x2F;world&#x2F;World.js:111</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Gravity to use when approximating the friction max force (mu<em>mass</em>gravity).</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_gravity" class="property item">
                        <h3 class="name"><code>gravity</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l100"><code>src&#x2F;world&#x2F;World.js:100</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Gravity in the world. This is applied on all bodies in the beginning of each step().</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_ISLAND_SLEEPING" class="property item">
                        <h3 class="name"><code>ISLAND_SLEEPING</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                            <span class="flag static">static</span>
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l392"><code>src&#x2F;world&#x2F;World.js:392</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Deactivates bodies that are in contact, if all of them are sleepy. Note that you must enable <a href="../classes/World.html#property_islandSplit" class="crosslink">.islandSplit</a> for this to work.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_islandManager" class="property item">
                        <h3 class="name"><code>islandManager</code></h3>
                        <span class="type"><a href="../classes/IslandManager.html" class="crosslink">IslandManager</a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l94"><code>src&#x2F;world&#x2F;World.js:94</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The island manager of this world.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_islandSplit" class="property item">
                        <h3 class="name"><code>islandSplit</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l227"><code>src&#x2F;world&#x2F;World.js:227</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Whether to enable island splitting. Island splitting can be an advantage for both precision and performance. See <a href="../classes/IslandManager.html" class="crosslink">IslandManager</a>.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> true</p>
                    
                    
                    </div>
                    <div id="property_lastTimeStep" class="property item">
                        <h3 class="name"><code>lastTimeStep</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l160"><code>src&#x2F;world&#x2F;World.js:160</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>For keeping track of what time step size we used last step</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_narrowphase" class="property item">
                        <h3 class="name"><code>narrowphase</code></h3>
                        <span class="type"><a href="../classes/Narrowphase.html" class="crosslink">Narrowphase</a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l86"><code>src&#x2F;world&#x2F;World.js:86</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The narrowphase to use to generate contacts.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_NO_SLEEPING" class="property item">
                        <h3 class="name"><code>NO_SLEEPING</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                            <span class="flag static">static</span>
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l378"><code>src&#x2F;world&#x2F;World.js:378</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Never deactivate bodies.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_overlapKeeper" class="property item">
                        <h3 class="name"><code>overlapKeeper</code></h3>
                        <span class="type"><a href="../classes/OverlapKeeper.html" class="crosslink">OverlapKeeper</a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l370"><code>src&#x2F;world&#x2F;World.js:370</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_sleepMode" class="property item">
                        <h3 class="name"><code>sleepMode</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l311"><code>src&#x2F;world&#x2F;World.js:311</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>How to deactivate bodies during simulation. Possible modes are: <a href="../classes/World.html#property_NO_SLEEPING" class="crosslink">World.NO_SLEEPING</a>, <a href="../classes/World.html#property_BODY_SLEEPING" class="crosslink">World.BODY_SLEEPING</a> and <a href="../classes/World.html#property_ISLAND_SLEEPING" class="crosslink">World.ISLAND_SLEEPING</a>.
                    If sleeping is enabled, you might need to <a href="../classes/Body.html#method_wakeUp" class="crosslink">wake up</a> the bodies if they fall asleep when they shouldn&#39;t. If you want to enable sleeping in the world, but want to disable it for a particular body, see <a href="../classes/Body.html#property_allowSleep" class="crosslink">Body.allowSleep</a>.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> World.NO_SLEEPING</p>
                    
                    
                    </div>
                    <div id="property_solveConstraints" class="property item">
                        <h3 class="name"><code>solveConstraints</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l191"><code>src&#x2F;world&#x2F;World.js:191</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Enable/disable constraint solving in each step.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> true</p>
                    
                    
                    </div>
                    <div id="property_solver" class="property item">
                        <h3 class="name"><code>solver</code></h3>
                        <span class="type"><a href="../classes/Solver.html" class="crosslink">Solver</a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l80"><code>src&#x2F;world&#x2F;World.js:80</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The solver used to satisfy constraints and contacts. Default is <a href="../classes/GSSolver.html" class="crosslink">GSSolver</a>.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_springs" class="property item">
                        <h3 class="name"><code>springs</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l59"><code>src&#x2F;world&#x2F;World.js:59</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>All springs in the world. To add a spring to the world, use <a href="../classes/World.html#method_addSpring" class="crosslink">addSpring</a>.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_stepping" class="property item">
                        <h3 class="name"><code>stepping</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l214"><code>src&#x2F;world&#x2F;World.js:214</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Is true during step().</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_time" class="property item">
                        <h3 class="name"><code>time</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l206"><code>src&#x2F;world&#x2F;World.js:206</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>World time.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_useFrictionGravityOnZeroGravity" class="property item">
                        <h3 class="name"><code>useFrictionGravityOnZeroGravity</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l124"><code>src&#x2F;world&#x2F;World.js:124</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>If the length of .gravity is zero, and .useWorldGravityAsFrictionGravity=true, then switch to using .frictionGravity for friction instead. This fallback is useful for gravityless games.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> true</p>
                    
                    
                    </div>
                    <div id="property_useWorldGravityAsFrictionGravity" class="property item">
                        <h3 class="name"><code>useWorldGravityAsFrictionGravity</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l117"><code>src&#x2F;world&#x2F;World.js:117</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Set to true if you want .frictionGravity to be automatically set to the length of .gravity.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> true</p>
                    
                    
                    </div>
            </div>


            <div id="events" class="api-class-tabpanel">
                <h2 class="off-left">Events</h2>

                    <div id="event_addBody" class="events item">
                        <h3 class="name"><code>addBody</code></h3>
                        <span class="type"><a href="../classes/.html" class="crosslink"></a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l254"><code>src&#x2F;world&#x2F;World.js:254</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Fired when a body is added to the world.</p>
                    
                        </div>
                    
                            <div class="params">
                                <h4>Event Payload:</h4>
                    
                                <ul class="params-list">
                                    <li class="param">
                                            <code class="param-name">body</code>
                                            <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                </ul>
                            </div>
                    
                    
                    </div>
                    <div id="event_addSpring" class="events item">
                        <h3 class="name"><code>addSpring</code></h3>
                        <span class="type"><a href="../classes/.html" class="crosslink"></a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l274"><code>src&#x2F;world&#x2F;World.js:274</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Fired when a spring is added to the world.</p>
                    
                        </div>
                    
                            <div class="params">
                                <h4>Event Payload:</h4>
                    
                                <ul class="params-list">
                                    <li class="param">
                                            <code class="param-name">spring</code>
                                            <span class="type"><a href="../classes/Spring.html" class="crosslink">Spring</a></span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                </ul>
                            </div>
                    
                    
                    </div>
                    <div id="event_beginContact" class="events item">
                        <h3 class="name"><code>beginContact</code></h3>
                        <span class="type"><a href="../classes/.html" class="crosslink"></a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l320"><code>src&#x2F;world&#x2F;World.js:320</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Fired when two shapes starts start to overlap. Fired in the narrowphase, during step.</p>
                    
                        </div>
                    
                            <div class="params">
                                <h4>Event Payload:</h4>
                    
                                <ul class="params-list">
                                    <li class="param">
                                            <code class="param-name">shapeA</code>
                                            <span class="type"><a href="../classes/Shape.html" class="crosslink">Shape</a></span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                    <li class="param">
                                            <code class="param-name">shapeB</code>
                                            <span class="type"><a href="../classes/Shape.html" class="crosslink">Shape</a></span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                    <li class="param">
                                            <code class="param-name">bodyA</code>
                                            <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                    <li class="param">
                                            <code class="param-name">bodyB</code>
                                            <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                    <li class="param">
                                            <code class="param-name">contactEquations</code>
                                            <span class="type">Array</span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                </ul>
                            </div>
                    
                    
                    </div>
                    <div id="event_endContact" class="events item">
                        <h3 class="name"><code>endContact</code></h3>
                        <span class="type"><a href="../classes/.html" class="crosslink"></a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l338"><code>src&#x2F;world&#x2F;World.js:338</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Fired when two shapes stop overlapping, after the narrowphase (during step).</p>
                    
                        </div>
                    
                            <div class="params">
                                <h4>Event Payload:</h4>
                    
                                <ul class="params-list">
                                    <li class="param">
                                            <code class="param-name">shapeA</code>
                                            <span class="type"><a href="../classes/Shape.html" class="crosslink">Shape</a></span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                    <li class="param">
                                            <code class="param-name">shapeB</code>
                                            <span class="type"><a href="../classes/Shape.html" class="crosslink">Shape</a></span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                    <li class="param">
                                            <code class="param-name">bodyA</code>
                                            <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                    <li class="param">
                                            <code class="param-name">bodyB</code>
                                            <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                </ul>
                            </div>
                    
                    
                    </div>
                    <div id="event_impact" class="events item">
                        <h3 class="name"><code>impact</code></h3>
                        <span class="type"><a href="../classes/.html" class="crosslink"></a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l284"><code>src&#x2F;world&#x2F;World.js:284</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Fired when a first contact is created between two bodies. This event is fired after the step has been done.</p>
                    
                        </div>
                    
                            <div class="params">
                                <h4>Event Payload:</h4>
                    
                                <ul class="params-list">
                                    <li class="param">
                                            <code class="param-name">bodyA</code>
                                            <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                    <li class="param">
                                            <code class="param-name">bodyB</code>
                                            <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                </ul>
                            </div>
                    
                    
                    </div>
                    <div id="event_postBroadphase" class="events item">
                        <h3 class="name"><code>postBroadphase</code></h3>
                        <span class="type"><a href="../classes/.html" class="crosslink"></a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l299"><code>src&#x2F;world&#x2F;World.js:299</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Fired after the Broadphase has collected collision pairs in the world.
                    Inside the event handler, you can modify the pairs array as you like, to
                    prevent collisions between objects that you don&#39;t want.</p>
                    
                        </div>
                    
                            <div class="params">
                                <h4>Event Payload:</h4>
                    
                                <ul class="params-list">
                                    <li class="param">
                                            <code class="param-name">pairs</code>
                                            <span class="type">Array</span>
                    
                    
                                        <div class="param-description">
                                            <p>An array of collision pairs. If this array is [body1,body2,body3,body4], then the body pairs 1,2 and 3,4 would advance to narrowphase.</p>
                    
                                        </div>
                    
                                    </li>
                                </ul>
                            </div>
                    
                    
                    </div>
                    <div id="event_postStep" class="events item">
                        <h3 class="name"><code>postStep</code></h3>
                        <span class="type"><a href="../classes/.html" class="crosslink"></a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l246"><code>src&#x2F;world&#x2F;World.js:246</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Fired after the step().</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="event_preSolve" class="events item">
                        <h3 class="name"><code>preSolve</code></h3>
                        <span class="type"><a href="../classes/.html" class="crosslink"></a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l354"><code>src&#x2F;world&#x2F;World.js:354</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Fired just before equations are added to the solver to be solved. Can be used to control what equations goes into the solver.</p>
                    
                        </div>
                    
                            <div class="params">
                                <h4>Event Payload:</h4>
                    
                                <ul class="params-list">
                                    <li class="param">
                                            <code class="param-name">contactEquations</code>
                                            <span class="type">Array</span>
                    
                    
                                        <div class="param-description">
                                            <p>An array of contacts to be solved.</p>
                    
                                        </div>
                    
                                    </li>
                                    <li class="param">
                                            <code class="param-name">frictionEquations</code>
                                            <span class="type">Array</span>
                    
                    
                                        <div class="param-description">
                                            <p>An array of friction equations to be solved.</p>
                    
                                        </div>
                    
                                    </li>
                                </ul>
                            </div>
                    
                    
                    </div>
                    <div id="event_removeBody" class="events item">
                        <h3 class="name"><code>removeBody</code></h3>
                        <span class="type"><a href="../classes/.html" class="crosslink"></a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_world_World.js.html#l264"><code>src&#x2F;world&#x2F;World.js:264</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Fired when a body is removed from the world.</p>
                    
                        </div>
                    
                            <div class="params">
                                <h4>Event Payload:</h4>
                    
                                <ul class="params-list">
                                    <li class="param">
                                            <code class="param-name">body</code>
                                            <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>
                    
                    
                                        <div class="param-description">
                                             
                                        </div>
                    
                                    </li>
                                </ul>
                            </div>
                    
                    
                    </div>
            </div>
    </div>
</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
